package com.sixth.volunteerservicesystem.ServiceImpl;

import com.sixth.volunteerservicesystem.Dao.VideoRepository;
import com.sixth.volunteerservicesystem.Service.Videoservice;
import com.sixth.volunteerservicesystem.domain.Video;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Videoserviceimpl implements Videoservice {
@Autowired
VideoRepository videoRepository;
    @Override
    public List<Video> list() {
        return videoRepository.findAll();
    }

    @Override
    public void upload(Video video) {

        videoRepository.save(video);
    }

    @Override
    public void delete(int id) {
        videoRepository.deleteById(id);
    }

}
